set(ARM_PREFIX arm-frc2021-linux-gnueabi)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

# In the docker build this folder doesn't exist?
set(CMAKE_SYSROOT /usr/${ARM_PREFIX})

# https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)

set(CMAKE_C_COMPILER /usr/local/bin/${ARM_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER /usr/local/bin/${ARM_PREFIX}-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)

set(CMAKE_MODULE_PATH ${CMAKE_SYSROOT}/usr/share/cmake/Modules)

#message(" ")
#message("Target system name: ${CMAKE_SYSTEM_NAME}")
#message("Target arch: ${CMAKE_SYSTEM_PROCESSOR}")
#message("C compiler: ${CMAKE_C_COMPILER}")
#message("C++ compiler: ${CMAKE_CXX_COMPILER}")
#message(" ")
